// Server-side Code

// Define actions which can be called from the client using ss.rpc('demo.ACTIONNAME', param1, param2...)
var key = 0
exports.add = function(element) {
	element.key = key++

	var timestamp = function() {
	  var d = new Date();
	    var pad2 = function(number) {
	      return (number < 10 ? '0' : '') + number;
	    };
	  return d.getHours() + ':' + pad2(d.getMinutes()) + ':' + pad2(d.getSeconds());
	};


	element.date = timestamp();

    return element
}

exports.elements = function() {
    return [
    	{
    		message: '1',
    		date: 123
    	},
    	{
    		message: '2',
    		date: 123
    	},
    ]
}


